buf="""
aaa
bbb
ccc
"""
line_list=buf.splitlines()
line_list.remove('')    #去除空字符
print(line_list)
"['aaa', 'bbb', 'ccc']"